import { ILoadMapTypeAll, formatDecimal } from '@/common';
import { formatDecimalFour } from '../../Acommon';
import { RegularExpression } from '@/common/constVariable';
import { useDescriptionsType } from '@/components/DescriptionsType';
import MyIcon from '@/components/MyIcon';
import { UploadFormCommon } from '@/components/UploadForm';
import { handleNotPostion } from '@/pages/ContractController/ContractManage/mconfig';
import { getFlowOrgTreeByOrgIDService, getUserDataList } from '@/services/BaseLayout';
import {
  downloadTemplate,
  getFileNameNotType,
  getSelectDataCommon,
  getSelectDataMapList,
  getTenantID,
  getUserDepID,
  getUserID,
  removeDateHmsStr,
  splitFileUrl,
} from '@/utils';
import { DatePicker, Form, Input, InputNumber, Select, Switch, Tooltip, TreeSelect, message } from 'antd';
import { useCallback, useEffect, useState } from 'react';
import { TagSelectNew as TagSelect } from '@/components/TagSelectNew';

const getEquipmentFurnitureUpdateConfig = ({ pageType, record, assetEquipmentFurnitureForm, loadMapInfo, mapLoading, changeAssetType, selectAssetType }) => {
  /** 获取组织机构树接口 */
  const { getFlowOrgTreeRun, getFlowOrgTreeLoading, getFlowOrgList } = getFlowOrgTreeByOrgIDService();

  /**资产分类数据字典*/
  const materialTypeMapList = getSelectDataMapList(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.MATERIAL_TYPE}`], 'name', 'id', true);
  /** 折旧方法列表 */
  const depreciateTypeList = getSelectDataCommon(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.AVERAGE_LIFE_METHOD}`], 'name', 'id');
  /** 产权列表 */
  const ownershipList = getSelectDataCommon(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_EQUITY}`], 'name', 'id');
  /** 单位会计科目 */
  const ledgerAccountList = getSelectDataCommon(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.LEDGER_ACCOUNT}`], 'name', 'id');
  /** 财务入账状态 */
  const entryStateList = getSelectDataCommon(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_ENTRY_STATE}`], 'name', 'id');
  /** 定密状态 */
  const denseStateList = getSelectDataCommon(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_DENSE_STATE}`], 'name', 'id');
  /** 使用责任主体 */
  const subjectToliabilityList = getSelectDataCommon(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_RESPONSIBILITY}`], 'name', 'id');
  /** 资产存放区域类型 */
  const locationList = getSelectDataMapList(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_AREA}`], 'name', 'id', true);

  /** 区分选资管部门、使用部门 */
  const [type, setType] = useState<string>('both');
  // 取得方式是其他
  const [isOthers, setIsOthers] = useState<boolean>(false);

  /** 当前页面是否为详情类型 */
  const disabled: boolean = pageType === 'detail' || pageType === 'hidden';

  const isHiddenState: boolean = pageType === 'hidden';

  /** 获取当前部门用户数据 */
  const { getUserRun, getUserLoading, getUserList } = getUserDataList((res: any) => {
    if (!(res && res?.msgFlag)) {
      message.error(res?.msg);
    } else {
      if (type === 'user') {
        setUserDataList({
          data: getUserList,
          loading: getUserLoading,
        });
      } else if (type === 'admin') {
        setAdminDataList({
          data: getUserList,
          loading: getUserLoading,
        });
      } else {
        setUserDataList({
          data: getUserList,
          loading: getUserLoading,
        });
        setAdminDataList({
          data: getUserList,
          loading: getUserLoading,
        });
      }
    }
  });

  /** 获取当前资管部门用户数据 */
  const [adminDataList, setAdminDataList] = useState<any>({
    data: getUserList,
    loading: getUserLoading,
  });

  /** 获取当前使用部门用户数据 */
  const [userDataList, setUserDataList] = useState<any>({
    data: getUserList,
    loading: getUserLoading,
  });

  /** 记账日期，记账凭证号必填字段状态 */
  const [entryState, setEntryState] = useState<boolean>(true);

  /** 是否入账，未入账隐藏非必填项 */
  const [isEntry, setIsEntry] = useState<boolean>(true);

  /** 新购时必填字段状态 */
  const [newBuyState, setNewBuyState] = useState<boolean>(true);

  /** 资金来源字段校验 */
  const [jnoState, setJnoState] = useState<boolean>(false);

  /** 获取当前部门用户数据 */
  const changeGetUser = (value: string | number, type: string) => {
    if (type === 'admin') {
      /** 置空当前选中的资管人 */
      assetEquipmentFurnitureForm?.setFieldValue('asseterID', '');
    } else {
      /** 置空当前选中的使用人 */
      assetEquipmentFurnitureForm?.setFieldValue('userID', '');
    }
    getUserRun({
      /** 获取当前使用部门用户信息 */
      userDepartmentID: value,
    });
  };

  // 筛选资产用途list
  const handleProcessUsedList = useCallback(
    (list) => {
      // 设备和其他 过滤掉10开头，车辆 过滤掉20开头
      if (list) {
        let newList: any = JSON.parse(JSON.stringify(list));
        if (selectAssetType == '100124021002') {
          newList = newList.filter((item) => !item.name.startsWith('20'));
        } else {
          newList = newList.filter((item) => !item.name.startsWith('10'));
        }
        return newList;
      }
    },
    [selectAssetType],
  );

  useEffect(() => {
    if (assetEquipmentFurnitureForm.getFieldValue('entryState') == `${getTenantID()}${ILoadMapTypeAll.ASSET_ENTRY_STATE}1000`) {
      setEntryState(true);
    } else {
      setEntryState(false);
    }
  }, [entryState]);

  useEffect(() => {
    if (assetEquipmentFurnitureForm.getFieldValue('entryState') == `${getTenantID()}${ILoadMapTypeAll.ASSET_ENTRY_STATE}1002`) {
      setIsEntry(true);
    } else {
      setIsEntry(false);
    }
  }, [entryState]);

  useEffect(() => {
    if (assetEquipmentFurnitureForm.getFieldValue('obtainType') == `${getTenantID()}${ILoadMapTypeAll.ASSET_ACQUIRE_TYPE}1000`) {
      setNewBuyState(true);
    } else {
      setNewBuyState(false);
    }
  }, [newBuyState]);

  useEffect(() => {
    if (assetEquipmentFurnitureForm.getFieldValue('projectName') === '中央财政资金') {
      setJnoState(true);
    } else {
      setJnoState(false);
    }
  }, [entryState]);

  useEffect(() => {
    /** 初始化请求组织机构 */
    let payload = {
      params: '0',
      flowType: '0',
    };
    getFlowOrgTreeRun(payload);
    /** 回填表单 */
    if (disabled || isHiddenState || pageType === 'edit') {
      if (record.projectName === '中央财政资金') {
        setJnoState(true);
      } else {
        setJnoState(false);
      }
      if (record.obtainType == `${getTenantID()}${ILoadMapTypeAll.ASSET_ACQUIRE_TYPE}1000`) {
        setNewBuyState(true);
      } else {
        setNewBuyState(false);
      }
      if (record.entryState == `${getTenantID()}${ILoadMapTypeAll.ASSET_ENTRY_STATE}1000`) {
        setEntryState(true);
      } else {
        setEntryState(false);
      }
      if (record.entryState == `${getTenantID()}${ILoadMapTypeAll.ASSET_ENTRY_STATE}1002`) {
        setIsEntry(true);
      } else {
        setIsEntry(false);
      }
      getUserRun({
        //获取当前部门用户信息
        userDepartmentID: record?.useDepartmentID ? record?.useDepartmentID : getUserDepID(),
      });
      assetEquipmentFurnitureForm?.setFieldsValue({
        ...record,
        assetDepartmentID: record?.assetDepartmentID ? record?.assetDepartmentID : getUserDepID(),
        asseterID: record?.asseterID ? record?.asseterID : getUserID(),
      });
      // 判断取得方式是不是其他
      setIsOthers(record.obtainType == '100124241005');
    } else {
      setEntryState(true);
      // getUserRun({
      //   //获取当前部门用户信息
      //   userDepartmentID: getUserDepID(),
      // });
    }
  }, [record]);

  const [equipmentFurnitureConfig, equipmentFurnitureMethods] = useDescriptionsType({
    labelWidth: 190,
    basicForm: assetEquipmentFurnitureForm,
    name: 'accept-assetEquipmentFurnitureForm',
    schemas: [
      /** 基本信息 */
      {
        key: 'accept-basic',
        title: '基本信息',
        fieldChildren: [
          {
            field: `assetCode`,
            label: `资产编号`,
            component: 'Input',
            disabled: true,
            placeholder: '自动生成',
            // required: !disabled,
          },
          {
            field: `assetClass`,
            label: `资产分类`,
            component: 'TreeSelect',
            placeholder: '请选择',
            disabled: disabled,
            required: !disabled,
            render: (text) => {
              if (disabled) {
                return <span>{record?.assetClassName ? record?.assetClassName.split('||')[0] : '--'}</span>;
                // return <TreeSelect
                //   value={text}
                //   treeData={materialTypeMapList}
                //   fieldNames={{
                //     label: 'name',
                //     value: 'id',
                //     children: 'children',
                //   }}
                //   showArrow={false}
                //   disabled={true}
                // />
              } else {
                return (
                  <TreeSelect
                    value={text}
                    loading={mapLoading}
                    placeholder="请选择"
                    treeData={materialTypeMapList}
                    // disabled={!(pageType === 'add' || record.formAddFlag)}
                    showArrow={!disabled}
                    fieldNames={{
                      label: 'name',
                      value: 'id',
                      children: 'children',
                    }}
                    showSearch={true}
                    treeNodeFilterProp={'name'}
                    allowClear={true}
                    onSelect={(value: string | number, node: any) => {
                      assetEquipmentFurnitureForm?.setFieldValue('depreciationYear', node?.remark);
                      changeAssetType(value, node);
                    }}
                  />
                );
              }
            },
          },
          {
            field: `assetName`,
            label: `资产名称`,
            component: 'Input',
            disabled: disabled,
            placeholder: '请选择',
            required: !disabled,
          },
          {
            field: `quantityOrArea`,
            label: `数量/面积`,
            required: !disabled,
            component: 'Render',
            disabled: !(pageType === 'add' || record.formAddFlag),
            placeholder: '请输入',
            min: 0,
            pattern: RegularExpression?.twoFloatNumber,
            patternMsg: '请输入整数或保留两位小数',
            render: (text: string | number) => {
              if (disabled) {
                return <span>{text || text == 0 ? formatDecimal(text) : '--'}</span>;
              } else {
                return (
                  <InputNumber
                    value={text}
                    placeholder="请输入"
                    precision={2}
                    onChange={(e: any) => {
                      assetEquipmentFurnitureForm?.setFieldValue('quantityOrArea', e);
                      if (
                        (assetEquipmentFurnitureForm?.getFieldValue('totalValue') !== '' ||
                          assetEquipmentFurnitureForm?.getFieldValue('totalValue') !== undefined) &&
                        typeof e === 'number'
                      ) {
                        let num: number = Number((assetEquipmentFurnitureForm?.getFieldValue('totalValue') / e).toFixed(2));
                        assetEquipmentFurnitureForm?.setFieldValue('assetValue', num);
                      }
                    }}
                  />
                );
              }
            },
          },
          {
            field: `unitOfMeasurement`,
            label: `计量单位`,
            disabled: disabled,
            component: 'Render',
            required: !disabled,
            message: '请选择计量单位',
            render: (text) => {
              if (disabled) {
                return <span>{record?.unitOfMeasurementName ? record?.unitOfMeasurementName.split('||')[0] : '--'}</span>;
                // return <Select
                //   value={text}
                //   options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.MATERIAL_MIDI}`]}
                //   fieldNames={{
                //     label: 'name',
                //     value: 'id',
                //   }}
                //   showArrow={false}
                //   disabled={true}
                // />
              } else {
                return (
                  <Select
                    value={text}
                    loading={mapLoading}
                    options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.MATERIAL_MIDI}`]}
                    disabled={disabled}
                    placeholder="请选择"
                    fieldNames={{
                      label: 'name',
                      value: 'id',
                    }}
                  />
                );
              }
            },
          },
          {
            field: `procureOrgType`,
            label: `采购组织形式`,
            disabled: disabled,
            component: 'Render',
            required: !disabled,
            message: '请选择采购组织形式',
            render: (text) => {
              if (disabled) {
                return <span>{record?.procureOrgTypeName ? record?.procureOrgTypeName.split('||')[0] : '--'}</span>;
                // return <Select
                //   value={text}
                //   options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_PURCHASE_TYPE}`]}
                //   fieldNames={{
                //     label: 'name',
                //     value: 'id',
                //   }}
                //   showArrow={false}
                //   disabled={true}
                // />
              } else {
                return (
                  <Select
                    loading={mapLoading}
                    options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_PURCHASE_TYPE}`]}
                    disabled={disabled}
                    placeholder="请选择"
                    fieldNames={{
                      label: 'name',
                      value: 'id',
                    }}
                  />
                );
              }
            },
          },
          {
            field: `obtainType`,
            label: `取得方式`,
            disabled: disabled,
            component: 'Render',
            required: !disabled,
            message: '请选择取得方式',
            render: (text) => {
              if (disabled) {
                return <span>{record?.obtainTypeName ? record?.obtainTypeName.split('||')[0] : '--'}</span>;
                // return <Select
                //   value={text}
                //   options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_ACQUIRE_TYPE}`]}
                //   fieldNames={{
                //     label: 'name',
                //     value: 'id',
                //   }}
                //   showArrow={false}
                //   disabled={true}
                // />
              } else {
                return (
                  <Select
                    loading={mapLoading}
                    options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_ACQUIRE_TYPE}`]}
                    disabled={disabled}
                    placeholder="请选择"
                    fieldNames={{
                      label: 'name',
                      value: 'id',
                    }}
                    onChange={(value) => {
                      setIsOthers(value == '100124241005');
                      assetEquipmentFurnitureForm?.setFieldValue('obtainType', value);
                      if (assetEquipmentFurnitureForm?.getFieldValue('obtainType') == `${getTenantID()}${ILoadMapTypeAll.ASSET_ACQUIRE_TYPE}1000`) {
                        setNewBuyState(true);
                        assetEquipmentFurnitureForm?.setFieldValue('valueType', `${getTenantID()}${ILoadMapTypeAll.ASSET_VALUE_TYPE}1000`);
                      } else {
                        assetEquipmentFurnitureForm?.setFieldValue('valueType', ``);
                        setNewBuyState(false);
                      }
                    }}
                  />
                );
              }
            },
          },
          {
            field: `obtainDate`,
            label: `取得日期`,
            component: 'Render',
            disabled: disabled,
            format: 'YYYY-MM-DD',
            placeholder: '请选择',
            required: !disabled,
            render: (text) => {
              if (disabled) {
                return <span>{removeDateHmsStr(text) || '--'}</span>;
              } else {
                return <DatePicker placeholder="请选择" format="YYYY-MM-DD" />;
              }
            },
          },
          {
            field: `usedType`,
            label: `资产用途`,
            disabled: disabled,
            component: 'Render',
            placeholder: '请选择',
            message: '请选择资产用途',
            required: true,
            // ishidden: isOthers,
            render: (text) => {
              if (disabled) {
                return <span>{record?.usedTypeName ? record?.usedTypeName.split('||')[0] : '--'}</span>;
                // return <Select
                //   value={text}
                //   options={handleProcessUsedList(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_USED}`])}
                //   fieldNames={{
                //     label: 'name',
                //     value: 'id',
                //   }}
                //   showArrow={false}
                //   disabled={true}
                // />
              } else {
                return (
                  <Select
                    loading={mapLoading}
                    options={handleProcessUsedList(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_USED}`])}
                    disabled={disabled}
                    placeholder="请选择"
                    fieldNames={{
                      label: 'name',
                      value: 'id',
                    }}
                  />
                );
              }
            },
          },
          {
            field: `operationalDate`,
            label: `投入使用日期`,
            component: 'Render',
            disabled: disabled,
            ishidden: !disabled,
            format: 'YYYY-MM-DD',
            placeholder: '请选择',
            render: (text) => {
              if (disabled) {
                return <span>{removeDateHmsStr(text) || '--'}</span>;
              } else {
                return <DatePicker placeholder="请选择" format="YYYY-MM-DD" />;
              }
            },
          },
          {
            field: `approvedBy`,
            label: `配置批准单位`,
            disabled: disabled,
            component: 'Input',
            placeholder: '请选择',
            message: '请选择配置批准单位',
            required: !disabled,
            render: (text) => {
              if (disabled) {
                return <span>{record?.approvedByName ? record?.approvedByName.split('||')[0] : '--'}</span>;
                // return <Select
                //   value={text}
                //   options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_APPROVEDBY}`]}
                //   fieldNames={{
                //     label: 'name',
                //     value: 'id',
                //   }}
                //   showArrow={false}
                //   disabled={true}
                // />
              } else {
                return (
                  <Select
                    loading={mapLoading}
                    options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_APPROVEDBY}`]}
                    disabled={disabled}
                    placeholder="请选择"
                    fieldNames={{
                      label: 'name',
                      value: 'id',
                    }}
                  />
                );
              }
            },
          },
          {
            field: `ownership`,
            label: `产权`,
            disabled: disabled,
            component: 'Render',
            required: !disabled,
            render: (text) => {
              if (disabled) {
                return <span>{record?.ownershipName ? record?.ownershipName.split('||')[0] : '--'}</span>;
              } else {
                return (
                  <TagSelect
                    colSpan={24}
                    formLabel={''}
                    formName={'ownership'}
                    defalultKeys={text ? text : `${getTenantID()}${ILoadMapTypeAll.ASSET_EQUITY}1000`}
                    radioDisabled={disabled}
                    radioList={ownershipList}
                  />
                );
              }
            },
          },
          {
            field: `location`,
            label: `存放区域`,
            component: 'Render',
            // required: !disabled,
            ishidden: !disabled,
            disabled: true,
            render: (text) => {
              if (disabled) {
                return <span>{record?.locationName ? record?.locationName.split('||')[0] : '--'}</span>;
                // return <TreeSelect
                //   value={text}
                //   treeData={locationList}
                //   placeholder={'--'}
                //   fieldNames={{
                //     label: 'name',
                //     value: 'id',
                //     children: 'children',
                //   }}
                //   showArrow={false}
                //   disabled={true}
                // />
              } else {
                return (
                  <TreeSelect
                    loading={mapLoading}
                    placeholder="请选择"
                    treeData={locationList}
                    disabled={true}
                    showArrow={disabled}
                    fieldNames={{
                      label: 'name',
                      value: 'id',
                      children: 'children',
                    }}
                    showSearch={true}
                    treeNodeFilterProp={'name'}
                    allowClear={true}
                  />
                );
              }
            },
          },
          {
            field: `locationInfo`,
            label: `详细地点`,
            component: 'Render',
            ishidden: !disabled,
            disabled: true,
            placeholder: '请输入',
            render: (text) => {
              if (disabled) {
                return <span>{text ? text : '--'}</span>;
              } else {
                return <Input placeholder="请输入" disabled={true} />;
              }
            },
          },
        ],
      },
      /** 财务信息 */
      {
        key: 'accept-info',
        title: '财务信息',
        fieldChildren: [
          {
            field: `totalValue`,
            label: `资产原值`,
            component: 'Render',
            placeholder: '请输入',
            required: !disabled,
            disabled: disabled,
            min: 0,
            contentAfter: '元',
            precision: 4,
            pattern: RegularExpression?.fourFloatNumber,
            patternMsg: '请输入整数或保留四位小数',
            render: (text: string | number) => {
              if (disabled) {
                return <span>{text || text == 0 ? formatDecimalFour(text) : '--'}</span>;
              } else {
                return (
                  <InputNumber
                    value={text}
                    placeholder="请输入"
                    precision={4}
                    onChange={(e: any) => {
                      assetEquipmentFurnitureForm?.setFieldValue('totalValue', e);
                      if (
                        (assetEquipmentFurnitureForm?.getFieldValue('quantityOrArea') !== '' ||
                          assetEquipmentFurnitureForm?.getFieldValue('quantityOrArea') !== undefined) &&
                        typeof e === 'number'
                      ) {
                        let num: number = Number((e / assetEquipmentFurnitureForm?.getFieldValue('quantityOrArea')).toFixed(4));
                        assetEquipmentFurnitureForm?.setFieldValue('assetValue', num);
                      }
                    }}
                  />
                );
              }
            },
          },
          {
            field: `assetValue`,
            label: `均价/单价`,
            placeholder: '请输入',
            required: !disabled,
            disabled: disabled,
            min: 0,
            contentAfter: '元',
            precision: 4,
            pattern: RegularExpression?.fourFloatNumber,
            patternMsg: '请输入整数或保留四位小数',
            component: 'Render',
            render: (text: string | number) => {
              if (disabled) {
                return <span>{text || text == 0 ? formatDecimalFour(text) : '--'}</span>;
              } else {
                return <InputNumber disabled={true} value={text} placeholder="请输入" precision={4} />;
              }
            },
          },
          {
            field: `entryState`,
            label: `财务入账状态`,
            component: 'Render',
            disabled: disabled,
            // required: !disabled,
            required: false,
            render: (text) => {
              if (disabled) {
                return <span>{record?.entryStateName ? record?.entryStateName.split('||')[0] : '--'}</span>;
              } else {
                return (
                  <TagSelect
                    colSpan={24}
                    formLabel={''}
                    formName={'entryState'}
                    defalultKeys={text ? text : `${getTenantID()}${ILoadMapTypeAll.ASSET_ENTRY_STATE}1002`}
                    radioDisabled={disabled}
                    radioList={entryStateList}
                    onChange={(value: number | string) => {
                      assetEquipmentFurnitureForm?.setFieldValue('entryState', value);
                      if (assetEquipmentFurnitureForm?.getFieldValue('entryState') == `${getTenantID()}${ILoadMapTypeAll.ASSET_ENTRY_STATE}1000`) {
                        setEntryState(true);
                      } else {
                        setEntryState(false);
                      }
                      if (assetEquipmentFurnitureForm?.getFieldValue('entryState') == `${getTenantID()}${ILoadMapTypeAll.ASSET_ENTRY_STATE}1002`) {
                        setIsEntry(true);
                      } else {
                        setIsEntry(false);
                      }
                    }}
                  />
                );
              }
            },
          },
          {
            field: `ledgerAccount`,
            label: `单位会计科目`,
            component: 'Render',
            disabled: disabled,
            // required: !disabled,
            // required: pageType === 'edit',
            placeholder: '请选择',
            ishidden: isEntry,
            render: (text) => {
              if (disabled) {
                return <span>{record?.ledgerAccountName ? record?.ledgerAccountName.split('||')[0] : '--'}</span>;
              } else {
                return (
                  <TagSelect
                    colSpan={24}
                    formLabel={''}
                    formName={'ledgerAccount'}
                    defalultKeys={text ? text : `${getTenantID()}${ILoadMapTypeAll.LEDGER_ACCOUNT}1000`}
                    radioDisabled={disabled}
                    radioList={ledgerAccountList}
                  />
                );
              }
            },
          },
          {
            field: `valueType`,
            label: `价值类型`,
            disabled: disabled,
            component: 'Render',
            // required: !disabled,
            // required: pageType === 'edit',
            required: false,
            ishidden: isEntry,
            message: '请选择价值类型',
            render: (text) => {
              if (disabled) {
                return <span>{record?.valueTypeName ? record?.valueTypeName.split('||')[0] : '--'}</span>;
                // return <Select
                //   value={text}
                //   options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_VALUE_TYPE}`]}
                //   fieldNames={{
                //     label: 'name',
                //     value: 'id',
                //   }}
                //   showArrow={false}
                //   disabled={true}
                // />
              } else {
                return (
                  <Select
                    loading={mapLoading}
                    options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_VALUE_TYPE}`]}
                    disabled={disabled}
                    placeholder="请选择"
                    fieldNames={{
                      label: 'name',
                      value: 'id',
                    }}
                  />
                );
              }
            },
          },
          {
            field: `fiscalAppropriation`,
            label: `财政拨款`,
            placeholder: '请输入',
            // required: !disabled,
            disabled: disabled,
            min: 0,
            contentAfter: '元',
            pattern: RegularExpression?.fourFloatNumber,
            patternMsg: '请输入整数或保留四位小数',
            ishidden: isEntry,
            component: 'Render',
            render: (text: string | number) => {
              if (disabled) {
                return <span>{text || text == 0 ? formatDecimalFour(text) : '--'}</span>;
              } else {
                return <InputNumber value={text} placeholder="请输入" precision={4} />;
              }
            },
          },
          {
            field: `noFiscalAppropriation`,
            label: `非财政拨款`,
            placeholder: '请输入',
            // required: !disabled,
            disabled: disabled,
            min: 0,
            contentAfter: '元',
            pattern: RegularExpression?.fourFloatNumber,
            patternMsg: '请输入整数或保留四位小数',
            ishidden: isEntry,
            component: 'Render',
            render: (text: string | number) => {
              if (disabled) {
                return <span>{text || text == 0 ? formatDecimalFour(text) : '--'}</span>;
              } else {
                return <InputNumber value={text} placeholder="请输入" precision={4} />;
              }
            },
          },
          {
            field: `projectName`,
            label: `资金来源`,
            disabled: disabled,
            component: 'Render',
            placeholder: '请输入',
            ishidden: !entryState || isEntry,
            // required: !disabled,
            render: (text) => {
              if (disabled) {
                return <span>{text ? text : '--'}</span>;
              } else {
                return (
                  <Input
                    value={text}
                    placeholder="请输入"
                    onChange={(e: any) => {
                      assetEquipmentFurnitureForm?.setFieldValue('projectName', e.target.value);
                      if (assetEquipmentFurnitureForm?.getFieldValue('projectName') === '中央财政资金') {
                        setJnoState(true);
                      } else {
                        setJnoState(false);
                      }
                    }}
                  />
                );
              }
            },
          },
          {
            field: `jno`,
            label: `项目代码`,
            disabled: disabled,
            component: 'Input',
            placeholder: '请输入',
            required: record?.id?.substring(0, 9) === 'assetInfo' && jnoState,
            ishidden: !entryState || (!(record?.id?.substring(0, 9) === 'assetInfo' && jnoState) && isEntry),
          },
          {
            field: `entryDate`,
            label: `记账日期`,
            component: 'Render',
            disabled: disabled,
            format: 'YYYY-MM-DD',
            placeholder: '请选择',
            ishidden: !(record?.id?.substring(0, 9) === 'assetInfo' && entryState && pageType === 'edit') && isEntry,
            required: record?.id?.substring(0, 9) === 'assetInfo' && entryState && pageType === 'edit',
            render: (text) => {
              if (disabled) {
                return <span>{removeDateHmsStr(text) || '--'}</span>;
              } else {
                return <DatePicker placeholder="请选择" format="YYYY-MM-DD" />;
              }
            },
          },
          {
            field: `entryCode`,
            label: `记账凭证号`,
            disabled: disabled,
            component: 'Render',
            placeholder: '请输入',
            ishidden: !(record?.id?.substring(0, 9) === 'assetInfo' && entryState && pageType === 'edit') && isEntry,
            required: record?.id?.substring(0, 9) === 'assetInfo' && entryState && pageType === 'edit',
            render: (text) => {
              if (disabled) {
                return <span>{text ? text : '--'}</span>;
              } else {
                return <Input value={text} placeholder="请输入" />;
              }
            },
          },
          {
            field: `depreciationState`,
            label: `折旧/摊销状态`,
            component: 'Render',
            disabled: true,
            // required: !disabled,
            // required: pageType === 'edit',
            placeholder: '请选择',
            message: '请选择折旧/摊销状态',
            ishidden: isEntry,
            render: (text) => {
              if (disabled) {
                return <span>{record?.depreciationStateName ? record?.depreciationStateName.split('||')[0] : '--'}</span>;
                // return <Select
                //   value={text}
                //   options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_LIFE_METHOD_STATUS}`]}
                //   fieldNames={{
                //     label: 'name',
                //     value: 'id',
                //   }}
                //   showArrow={false}
                //   disabled={true}
                // />
              } else {
                return (
                  <Select
                    loading={mapLoading}
                    options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_LIFE_METHOD_STATUS}`]}
                    disabled={disabled}
                    placeholder="请选择"
                    fieldNames={{
                      label: 'name',
                      value: 'id',
                    }}
                  />
                );
              }
            },
          },
          {
            field: `depreciationMethod`,
            label: `折旧/摊销方法`,
            // required: !disabled,
            // disabled: true,
            component: 'Render',
            placeholder: '请选择',
            ishidden: isEntry,
            render: (text) => {
              if (disabled) {
                return <span>{record?.depreciationMethodName ? record?.depreciationMethodName.split('||')[0] : '--'}</span>;
              } else {
                return (
                  <TagSelect
                    colSpan={24}
                    formLabel={''}
                    formName={'depreciationMethod'}
                    defalultKeys={text ? text : `${getTenantID()}${ILoadMapTypeAll.AVERAGE_LIFE_METHOD}1000`}
                    radioDisabled={disabled}
                    radioList={depreciateTypeList}
                  />
                );
              }
            },
          },
          {
            field: `depreciationYear`,
            label: `折旧/摊销年限`,
            placeholder: '请输入',
            disabled: true,
            min: 0,
            contentAfter: '月',
            required: false,
            pattern: RegularExpression?.number,
            patternMsg: '请输入整数',
            ishidden: isEntry,
            component: 'Render',
            render: (text: string | number) => {
              if (disabled) {
                return <span>{text || text == 0 ? text : '--'}</span>;
              } else {
                return <InputNumber value={text} placeholder="请输入" pattern={RegularExpression?.number} />;
              }
            },
          },
          {
            field: `scrapRate`,
            label: `残值率`,
            component: 'Render',
            placeholder: '请输入',
            disabled: true,
            min: 0,
            contentAfter: '%',
            // required: !disabled,
            // required: pageType === 'edit',
            pattern: RegularExpression?.twoFloatNumber,
            patternMsg: '请输入整数或保留两位小数',
            ishidden: isEntry,
            render: (text: string | number) => {
              if (disabled) {
                return <span>{text || text == 0 ? text : '--'}</span>;
              } else {
                return <InputNumber value={text} placeholder="请输入" precision={2} />;
              }
            },
          },
          {
            field: `providedDepreciation`,
            label: `已提折旧/摊销月数`,
            placeholder: '请输入',
            disabled: true,
            min: 0,
            // contentAfter: '元',
            // required: !disabled,
            pattern: RegularExpression?.number,
            patternMsg: '请输入整数',
            ishidden: isEntry,
            component: 'Render',
            render: (text: string | number) => {
              if (disabled) {
                return <span>{text || text == 0 ? text : '--'}</span>;
              } else {
                return <InputNumber value={text} placeholder="请输入" pattern={RegularExpression?.number} />;
              }
            },
          },
          // {
          //   field: `depreciationMoney`,
          //   label: `累计折旧/摊销`,
          //   placeholder: '请输入',
          //   disabled: true,
          //   min: 0,
          //   contentAfter: '元',
          //   // pattern: RegularExpression?.twoFloatNumber,
          //   // patternMsg: '请输入整数或保留两位小数',
          //   ishidden: isEntry,
          //   component: 'Render',
          //   render: (text: string | number) => {
          //     if (!(pageType === 'add' || record.formAddFlag)) {
          //       return <span>{text || text == 0 ? text : '--'}</span>;
          //     } else {
          //       return (
          //         <InputNumber
          //           value={text}
          //           placeholder="请输入"
          //           precision={2}
          //           onChange={(value: any) => {
          //             assetEquipmentFurnitureForm?.setFieldValue('depreciationMoney', value);
          //             if (Number(value) > 0) {
          //               assetEquipmentFurnitureForm?.setFieldValue('depreciationState', `${getTenantID()}${ILoadMapTypeAll.ASSET_LIFE_METHOD_STATUS}1000`);
          //             }
          //           }}
          //         />
          //       );
          //     }
          //   },
          // },
          {
            field: `totalDepreValue`,
            label: `累计折旧/摊销`,
            placeholder: '请输入',
            disabled: true,
            min: 0,
            contentAfter: '元',
            // pattern: RegularExpression?.twoFloatNumber,
            // patternMsg: '请输入整数或保留两位小数',
            ishidden: isEntry,
            component: 'Render',
            render: (text: string | number) => {
              if (!(pageType === 'add' || record.formAddFlag)) {
                return <span>{text || text == 0 ? text : '--'}</span>;
              } else {
                return (
                  <InputNumber
                    value={text}
                    placeholder="请输入"
                    precision={2}
                    onChange={(value: any) => {
                      assetEquipmentFurnitureForm?.setFieldValue('totalDepreValue', value);
                      if (Number(value) > 0) {
                        assetEquipmentFurnitureForm?.setFieldValue('depreciationState', `${getTenantID()}${ILoadMapTypeAll.ASSET_LIFE_METHOD_STATUS}1000`);
                      }
                    }}
                  />
                );
              }
            },
          },
          {
            field: `financialOfficer`,
            label: `财务负责人`,
            disabled: disabled,
            component: 'Render',
            placeholder: '请输入',
            ishidden: isEntry,
            render: (text) => {
              if (disabled) {
                return <span>{text ? text : '--'}</span>;
              } else {
                return <Input value={text} placeholder="请输入" />;
              }
            },
          },
        ],
      },
      /** 使用信息 */
      {
        key: 'accept-use-info',
        title: '使用信息',
        fieldChildren: [
          {
            field: `assetState`,
            label: `资产状态`,
            component: 'Render',
            ishidden: !disabled,
            colSpan: 2,
            // required: !disabled,
            disabled: disabled,
            message: '请选择资产状态',
            render: (text) => {
              if (disabled) {
                return <span>{record?.assetStateName ? record?.assetStateName.split('||')[0] : '--'}</span>;
                // return <Select
                //   value={text}
                //   options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_STATUS}`]}
                //   fieldNames={{
                //     label: 'name',
                //     value: 'id',
                //   }}
                //   showArrow={false}
                //   disabled={true}
                // />
              } else {
                return (
                  <Select
                    options={loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_STATUS}`]}
                    disabled={true}
                    placeholder="请选择"
                    value={text}
                    fieldNames={{
                      label: 'name',
                      value: 'id',
                    }}
                  />
                );
              }
            },
          },
          {
            field: `subjectToliability`,
            label: `使用责任主体`,
            // required: !disabled,
            required: pageType === 'edit',
            disabled: disabled,
            component: 'Render',
            placeholder: '请输入',
            render: (text) => {
              if (disabled) {
                return <span>{record?.subjectToliabilityName ? record?.subjectToliabilityName.split('||')[0] : '--'}</span>;
              } else {
                return (
                  <TagSelect
                    colSpan={24}
                    formLabel={''}
                    formName={'subjectToliability'}
                    defalultKeys={text ? text : `${getTenantID()}${ILoadMapTypeAll.ASSET_RESPONSIBILITY}1000`}
                    radioDisabled={disabled}
                    radioList={subjectToliabilityList}
                  />
                );
              }
            },
          },
          {
            field: `useDepartmentID`,
            label: `使用部门`,
            ishidden: isHiddenState || pageType == 'add' || record?.formAddFlag,
            disabled: pageType == 'edit' ? false : true,
            component: 'Render',
            // required: !disabled,
            render: (text) => {
              if (disabled) {
                return <span>{record?.useDepartmentName ? record?.useDepartmentName : '--'}</span>;
              } else {
                return (
                  <TreeSelect
                    loading={getFlowOrgTreeLoading}
                    placeholder="请选择"
                    treeData={handleNotPostion(getFlowOrgList)}
                    disabled={pageType == 'edit' ? false : true}
                    showArrow={!disabled}
                    fieldNames={{
                      label: 'title',
                      value: 'id',
                      children: 'children',
                    }}
                    showSearch={true}
                    treeNodeFilterProp={'title'}
                    allowClear={true}
                    onChange={(value: string | number) => {
                      userDataList.loading = true;
                      setUserDataList(userDataList);
                      setType('user');
                      changeGetUser(value, 'user');
                    }}
                  />
                );
              }
            },
          },
          {
            field: `assetDepartmentID`,
            label: `管理部门`,
            disabled: disabled,
            component: 'Render',
            // required: !disabled,
            required: pageType === 'edit',
            render: (text) => {
              if (disabled) {
                return <span>{record?.assetDepartmentName ? record?.assetDepartmentName : '--'}</span>;
              } else {
                return (
                  <TreeSelect
                    loading={getFlowOrgTreeLoading}
                    placeholder="请选择"
                    treeData={handleNotPostion(getFlowOrgList)}
                    disabled={disabled ? true : false}
                    showArrow={!disabled}
                    fieldNames={{
                      label: 'title',
                      value: 'id',
                      children: 'children',
                    }}
                    showSearch={true}
                    treeNodeFilterProp={'title'}
                    allowClear={true}
                    onChange={(value: string | number) => {
                      adminDataList.loading = true;
                      setAdminDataList(adminDataList);
                      setType('admin');
                      changeGetUser(value, 'admin');
                    }}
                  />
                );
              }
            },
          },
          {
            field: `userID`,
            label: `使用人`,
            disabled: pageType == 'edit' ? false : true,
            ishidden: isHiddenState || pageType == 'add' || record?.formAddFlag,
            component: 'Render',
            // required: !disabled,
            message: '请选择使用人',
            render: (text) => {
              if (disabled) {
                return <span>{record?.userName ? record?.userName : '--'}</span>;
              } else {
                return (
                  <Select
                    loading={userDataList.loading}
                    options={userDataList.data}
                    disabled={pageType == 'edit' ? false : true}
                    placeholder="请选择"
                    fieldNames={{
                      label: 'realName',
                      value: 'id',
                    }}
                  />
                );
              }
            },
          },
          {
            field: `asseterID`,
            label: `管理人`,
            disabled: disabled,
            component: 'Render',
            // required: !disabled,
            required: pageType === 'edit',
            message: '请选择管理人',
            render: (text) => {
              if (disabled) {
                return <span>{record?.asseterName ? record?.asseterName : '--'}</span>;
              } else {
                return (
                  <Select
                    loading={adminDataList.loading}
                    options={adminDataList.data}
                    disabled={disabled}
                    placeholder="请选择"
                    fieldNames={{
                      label: 'realName',
                      value: 'id',
                    }}
                  />
                );
              }
            },
          },
          {
            field: `sharing`,
            label: `是否共享共用`,
            component: 'Render',
            disabled: disabled,
            required: false,
            render: (text: any) => {
              return (
                <Switch
                  disabled={disabled}
                  checkedChildren="是"
                  unCheckedChildren="否"
                  checked={text === 1 ? true : false}
                  onChange={(checked) => {
                    assetEquipmentFurnitureForm?.setFieldValue('sharing', checked ? 1 : 0);
                  }}
                />
              );
            },
          },
          {
            field: `remark`,
            label: `备注`,
            colSpan: 2,
            disabled: disabled,
            showCount: true,
            placeholder: '请输入',
            component: 'Render',
            render: (text) => {
              if (disabled) {
                return <span style={{ paddingLeft: 8 }}>{text ? text : '--'}</span>;
              } else {
                return <Input.TextArea allowClear showCount maxLength={200} placeholder="请输入" autoSize={{ minRows: 1, maxRows: 2 }} />;
              }
            },
          },
        ],
      },
      /** 特性信息 */
      {
        key: 'accept-special',
        title: '特性信息',
        fieldChildren: [
          {
            field: `manufacturer`,
            label: `生产厂家`,
            disabled: disabled,
            component: 'Input',
            placeholder: disabled ? '--' : '请输入',
            // render: (text) => {
            //   if (disabled) {
            //     return <span>{text ? text : '--'}</span>;
            //   } else {
            //     return <Input disabled={disabled} placeholder="请输入" />;
            //   }
            // },
          },
          {
            field: `supplier`,
            label: `供应商`,
            disabled: disabled,
            component: 'Input',
            placeholder: disabled ? '--' : '请输入',
            required: !disabled,
            // required: record?.id?.substring(0, 9) === 'assetInfo' && newBuyState,
          },
          {
            field: `contractCode`,
            label: `采购合同编号`,
            disabled: disabled,
            component: 'Input',
            placeholder: disabled ? '--' : '请输入',
            required: record?.id?.substring(0, 9) === 'assetInfo' && newBuyState,
          },
          {
            field: `invoiceNumber`,
            label: `发票号`,
            disabled: disabled,
            component: 'Input',
            placeholder: disabled ? '--' : '请输入',
            initialvalue: '无',
            required: record?.id?.substring(0, 9) === 'assetInfo' && newBuyState,
          },
          {
            field: `brandType`,
            label: `品牌`,
            disabled: disabled,
            component: 'Input',
            placeholder: disabled ? '--' : '请输入',
            // required: !disabled,
            required: pageType === 'edit',
          },
          {
            field: `paramsInfo`,
            label: `规格型号`,
            disabled: disabled,
            component: 'Input',
            placeholder: disabled ? '--' : '请输入',
            // required: !disabled,
            required: pageType === 'edit',
          },
          {
            field: `productNumber`,
            label: `产品序列号`,
            disabled: disabled,
            component: 'Input',
            placeholder: disabled ? '--' : '请输入',
            required: false,
          },
          {
            field: `maintainEndDate`,
            label: `保修截止日期`,
            component: 'Render',
            disabled: disabled,
            format: 'YYYY-MM-DD',
            placeholder: '请选择',
            render: (text) => {
              if (disabled) {
                return <span>{removeDateHmsStr(text) || '--'}</span>;
              } else {
                return <DatePicker placeholder="请选择" disabled={disabled} format="YYYY-MM-DD" />;
              }
            },
          },
        ],
      },
      /** 密级信息 */
      // {
      //   key: 'accept-miji',
      //   title: '密级信息',
      //   fieldChildren: [
      //     {
      //       field: `denseState`,
      //       label: `定密状态`,
      //       component: 'Render',
      //       disabled: disabled,
      //       required: !disabled,
      //       render: (text) => {
      //         if (disabled) {
      //           return <span>{record?.denseStateName ? record?.denseStateName.split('||')[0] : '--'}</span>;
      //         } else {
      //           return (
      //             <TagSelect
      //               colSpan={24}
      //               formLabel={''}
      //               formName={'denseState'}
      //               defalultKeys={text || `${getTenantID()}${ILoadMapTypeAll.ASSET_DENSE_STATE}1000`}
      //               radioDisabled={disabled}
      //               radioList={denseStateList}
      //             />
      //           );
      //         }
      //       },
      //     },
      //     // {
      //     //   field: `denseDate`,
      //     //   label: `定密时间`,
      //     //   component: 'Render',
      //     //   disabled: disabled,
      //     //   format: 'YYYY-MM-DD',
      //     //   placeholder: '请选择',
      //     //   required: !disabled,
      //     //   render: (text) => {
      //     //     if (disabled) {
      //     //       return <span>{removeDateHmsStr(text) || '--'}</span>;
      //     //     } else {
      //     //       return <DatePicker placeholder="请选择" format="YYYY-MM-DD" />;
      //     //     }
      //     //   },
      //     // },
      //     // {
      //     //   field: `longTime`,
      //     //   label: `是否长期`,
      //     //   component: 'Render',
      //     //   disabled: disabled,
      //     //   required: !disabled,
      //     //   render: (text: any) => {
      //     //     return (
      //     //       <Switch
      //     //         disabled={disabled}
      //     //         checkedChildren="是"
      //     //         unCheckedChildren="否"
      //     //         checked={text === 1 ? true : false}
      //     //         onChange={(checked) => {
      //     //           assetEquipmentFurnitureForm?.setFieldValue('longTime', checked ? 1 : 0);
      //     //         }}
      //     //       />
      //     //     );
      //     //   },
      //     // },
      //     // {
      //     //   field: `secrecyTerm`,
      //     //   label: `保密期限`,
      //     //   disabled: disabled,
      //     //   component: 'Input',
      //     //   placeholder: '请输入',
      //     //   required: !disabled,
      //     // },
      //   ],
      // },
      /** 资产照片及附件 */
      {
        key: 'accept-fujian',
        title: '资产照片及附件',
        fieldChildren: [
          {
            field: `assetImage`,
            label: `资产图片`,
            component: 'Render',
            disabled: disabled,
            // required: !disabled,
            placeholder: '请上传',
            render: (text, record) => {
              const fileName = 'assetImage';
              return (
                <>
                  {pageType !== 'detail' ? (
                    <UploadFormCommon
                      form={assetEquipmentFurnitureForm}
                      fileFormName={fileName}
                      spanCol={24}
                      inRowProportion={24}
                      name={'attachFile'}
                      required={false}
                      accept={'.img|.png'}
                      disabledUpload={disabled}
                      url={'/assetInfo/uploadFile'}
                      downloadUrl={'/assetInfo/downloadFile'}
                      fileFormDelName={'delFile'}
                      uploadSuccessCallback={(attachPaths) => {
                        assetEquipmentFurnitureForm?.setFieldsValue({
                          assetImage: attachPaths,
                        });
                      }}
                      defaultFiles={text}
                      // maxFile={1}
                      // hintTitle={'且只能上传 1 个！'}
                      fieldBusiPath={'assetFile'}
                      // isShowUploadBtn={true}
                      delFunc={(delFilePath) => {
                        assetEquipmentFurnitureForm?.setFieldsValue({
                          assetImage: '',
                        });
                      }}
                    >
                      上传
                    </UploadFormCommon>
                  ) : (
                    <div
                      style={{
                        height: '100%',
                        display: 'flex',
                        alignItems: 'center',
                        marginLeft: '8px',
                      }}
                    >
                      {record?.[fileName]
                        ? splitFileUrl(record?.[fileName])?.map((e, i) => {
                            return (
                              <Tooltip title={e.attachName} key={new Date().getTime() * 25615265152 + e?.attachName}>
                                <a
                                  onClick={() => {
                                    message.success('下载中，请稍后...');
                                    downloadTemplate('/assetInfo/downloadFile', e?.attachName, e?.attachUrl, () => {});
                                  }}
                                >
                                  <MyIcon type="icon-file-text-fill" />
                                  &nbsp;
                                  {getFileNameNotType(e.attachName, 8)}
                                </a>
                              </Tooltip>
                            );
                          })
                        : '--'}
                    </div>
                  )}
                </>
              );
            },
          },
          {
            label: '说明文件',
            field: 'qualityUrl',
            placeholder: '请上传',
            component: 'Render',
            colSpan: 1,
            // required: !disabled,
            render: (text, record) => {
              const fileName = 'qualityUrl';
              return (
                <>
                  {pageType !== 'detail' ? (
                    <UploadFormCommon
                      form={assetEquipmentFurnitureForm}
                      fileFormName={fileName}
                      spanCol={24}
                      inRowProportion={24}
                      name={'attachFile'}
                      required={false}
                      disabledUpload={disabled}
                      // accept={'.doc|.docx'}
                      url={'/assetInfo/uploadFile'}
                      downloadUrl={'/assetInfo/downloadFile'}
                      fileFormDelName={'delFile'}
                      uploadSuccessCallback={(attachPaths) => {
                        assetEquipmentFurnitureForm?.setFieldsValue({
                          qualityUrl: attachPaths,
                        });
                      }}
                      defaultFiles={text}
                      // maxFile={1}
                      // hintTitle={'且只能上传 1 个！'}
                      fieldBusiPath={'assetFile'}
                      // isShowUploadBtn={true}
                      delFunc={(delFilePath) => {
                        assetEquipmentFurnitureForm?.setFieldsValue({
                          qualityUrl: '',
                        });
                      }}
                    >
                      上传
                    </UploadFormCommon>
                  ) : (
                    <div
                      style={{
                        height: '100%',
                        display: 'flex',
                        alignItems: 'center',
                        marginLeft: '8px',
                      }}
                    >
                      {record?.[fileName]
                        ? splitFileUrl(record?.[fileName])?.map((e, i) => {
                            return (
                              <Tooltip title={e.attachName} key={new Date().getTime() * 25615265152 + e?.attachName}>
                                <a
                                  onClick={() => {
                                    message.success('下载中，请稍后...');
                                    downloadTemplate('/assetInfo/downloadFile', e?.attachName, e?.attachUrl, () => {});
                                  }}
                                >
                                  <MyIcon type="icon-file-text-fill" />
                                  &nbsp;
                                  {getFileNameNotType(e.attachName, 8)}
                                </a>
                              </Tooltip>
                            );
                          })
                        : '--'}
                    </div>
                  )}
                </>
              );
            },
          },
        ],
      },
    ],
  });

  return {
    equipmentFurnitureConfig,
    equipmentFurnitureMethods,
  };
};

export { getEquipmentFurnitureUpdateConfig };
